<?php

class BackendBlogNewForm extends BaseBlogNewForm
{
    
    
  public function configure()
  {    
     
     
    $this->useFields(array('is_public','is_important','category_id', 'updated_at', 'title', 'summary','content','created_at'));      
   
    $this->widgetSchema['is_public'] = new sfWidgetFormInputCheckbox();
    $this->widgetSchema['is_important'] = new sfWidgetFormInputCheckbox();
    //$this->widgetSchema['updated_at'] = new sfWidgetFormI18nDateTime(array('culture' => 'es'), array('selected'=> '1'));    
    $this->widgetSchema['updated_at']->setOption('date', array('format' =>  '%day% %month% %year%'));
    $this->widgetSchema['updated_at']->setOption('default', time());
    $this->widgetSchema['title'] = new sfWidgetFormTextarea(array(),array('rows'=>2,'cols'=>90,'maxlength'=>250));
    $this->widgetSchema['summary'] = new sfWidgetFormTextarea(array(),array('rows'=>10,'cols'=>90,'maxlength'=>250, 'rich'=>true));
    $this->widgetSchema['content'] = new sfWidgetFormTextarea(array(),array('rows'=>25,'cols'=>90));
    $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden(array(), array('value' => date('Y-m-d h:i:s')));
    
    $this->validatorSchema['title'] = new sfValidatorString(array(),array('required'=>'Debe ingresar el titulo de la noticia.'));  
    $this->validatorSchema['summary'] = new sfValidatorString(array(),array('required'=>'Debe ingresar el resumen de la noticia.'));  
    $this->validatorSchema['content'] = new sfValidatorString(array(),array('required'=>'Debe ingresar el cuerpo de la noticia.'));  

    /*
    
    $this->setValidators(array(        
        'id' => new sfValidatorPass(),
        'is_public' => new sfValidatorAnd(),
        'is_important' => new sfValidatorAnd(),
        'category_id' => new sfValidatorAnd(),
        
        'title'   => new sfValidatorString(array('max_length' => 255),array('required' => 'El titulo es obligatorio')),
        'summary' => new sfValidatorString(array(),array('required' => 'El resumen es obligatorio')),
        'content' => new sfValidatorString(array(),array('required' => 'El cuerpo es obligatorio')),
        
        'updated_at' => new sfValidatorAnd(),        
        'created_at' => new sfValidatorAnd(),        
        
    ));
        
    */
    
      /*
      $blogMedium = new BlogMedium();      
      $form = new BlogMediumForm($blogMedium);
      //$this->embedForm('formmedium', $form);
      $this->form_medium = $form;
      */
    
  }
 
  
}
?>
